package com.xian.cloud.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.xian.cloud.dao.UserMapper;
import com.xian.cloud.entity.UserEntity;
import com.xian.cloud.service.UserService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

/**
 * @Author: xlr
 * @Date: Created in 11:36 PM 2019/9/11
 */
@Service
@Slf4j
public class UserServiceImpl extends ServiceImpl<UserMapper,UserEntity> implements UserService {

    @Override
    @Transactional(rollbackFor = Exception.class)
    public boolean updateTx(UserEntity entity) {
        int i = baseMapper.updateById(entity);
        if(i >0){
            return true;
        }
        return false;
    }
}
